package com.link2room.aeriabots.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by Nakisa on 2016/10/9.
 */
@Entity
@Table(name = "wx_fans")
@DynamicInsert
public class WxFans extends BaseEntity {
    private String openid;
    private String sceneStr;
    private Integer subNum;
    private String isSubscribe;

    @Basic
    @Column(name = "openid", nullable = true, length = 64)
    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }
    @Basic
    @Column(name = "scene_str", nullable = true, length = 32)
    public String getSceneStr() {
        return sceneStr;
    }

    public void setSceneStr(String sceneStr) {
        this.sceneStr = sceneStr;
    }
    @Basic
    @Column(name = "sub_num", nullable = true, length = 32)
    public Integer getSubNum() {
        return subNum;
    }

    public void setSubNum(Integer subNum) {
        this.subNum = subNum;
    }
    @Basic
    @Column(name = "is_subscribe", nullable = true, length = 2)
    public String getIsSubscribe() {
        return isSubscribe;
    }

    public void setIsSubscribe(String isSubscribe) {
        this.isSubscribe = isSubscribe;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WxFans wxFans = (WxFans) o;

        if (openid != null ? !openid.equals(wxFans.openid) : wxFans.openid != null) return false;
        if (sceneStr != null ? !sceneStr.equals(wxFans.sceneStr) : wxFans.sceneStr != null) return false;
        if (subNum != null ? !subNum.equals(wxFans.subNum) : wxFans.subNum != null) return false;
        if (isSubscribe != null ? !isSubscribe.equals(wxFans.isSubscribe) : wxFans.isSubscribe != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = openid != null ? openid.hashCode() : 0;
        result = 31 * result + (sceneStr != null ? sceneStr.hashCode() : 0);
        result = 31 * result + (subNum != null ? subNum.hashCode() : 0);
        result = 31 * result + (isSubscribe != null ? isSubscribe.hashCode() : 0);
        return result;
    }
}
